package dev.ece.suit.text;

public class RangeColorTextLine {

	private String text;
	
	private TextCharacter[] chars;

	private RangeColorTextLine() {}
	
	public static RangeColorTextLine createRangeColorTextLine(String text, TextLibrary textLibrary) {
		RangeColorTextLine line = new RangeColorTextLine();
		line.text = text;
		char[] chars = text.toCharArray();
		line.chars = new TextCharacter[chars.length];
		for(int i=0; i<chars.length; i++) {
			line.chars[i] = textLibrary.getCharacter(chars[i]);
		}
		return line;
	}

	public int count() {
		return this.chars.length;
	}
	
	public String getText() {
		return text;
	}

	public TextCharacter[] getChars() {
		return chars;
	}
	
}
